body { 
    margin: 0; 
    overflow: hidden; 
    background-color: #000; 
}
canvas { 
    display: block; 
}
#controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(10, 15, 25, 0.8); 
    color: #e0e0ff; 
    padding: 18px; 
    border-radius: 12px; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    z-index: 10;
    max-width: 320px; 
    box-shadow: 0 0 20px rgba(50, 100, 200, 0.3); 
    border: 1px solid rgba(80, 120, 230, 0.3); 
    backdrop-filter: blur(5px);
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 140, 230, 0.5) rgba(10, 15, 25, 0.2);
}

#controls::-webkit-scrollbar {
    width: 8px;
}

#controls::-webkit-scrollbar-track {
    background: rgba(10, 15, 25, 0.2);
    border-radius: 6px;
}

#controls::-webkit-scrollbar-thumb {
    background-color: rgba(100, 140, 230, 0.5);
    border-radius: 6px;
    border: 2px solid rgba(10, 15, 25, 0.2);
}

#controls::-webkit-scrollbar-thumb:hover {
    background-color: rgba(120, 160, 250, 0.7);
}

#controls div {
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(100, 140, 230, 0.2); 
}

#controls div:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

#controls label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500; 
    font-size: 0.95em;
    color: #a0c0ff; 
    text-shadow: 0 0 5px rgba(0, 50, 150, 0.5); 
}

#controls input[type="range"] {
    display: block;
    width: calc(100% - 60px);
    margin-right: 10px;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #1a2a4a; 
    border-radius: 3px;
    outline: none;
    opacity: 0.8;
    transition: all 0.2s;
    float: left;
}

#controls input[type="range"]:hover {
    opacity: 1;
    background: #2a3a5a; 
}

#controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4a80ff; 
    cursor: pointer;
    box-shadow: 0 0 5px rgba(50, 100, 255, 0.7); 
    transition: all 0.2s;
}

#controls input[type="range"]::-webkit-slider-thumb:hover {
    background: #5a90ff; 
    box-shadow: 0 0 10px rgba(70, 130, 255, 0.9); 
}

#controls input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4a80ff;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(50, 100, 255, 0.7);
    transition: all 0.2s;
    border: none; 
}

#controls input[type="range"]::-moz-range-thumb:hover {
    background: #5a90ff;
    box-shadow: 0 0 10px rgba(70, 130, 255, 0.9);
}

#controls span {
    vertical-align: middle;
    font-size: 0.9em;
    float: right;
    width: 50px;
    text-align: right;
    padding: 4px 0;
    color: #d0e0ff; 
}

/* Button styling */
#controls button {
    background: linear-gradient(to bottom, #4a80ff, #3060e0); 
    border: none;
    color: white;
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 100, 0.3); 
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); 
}

#controls button:hover {
    background: linear-gradient(to bottom, #5a90ff, #4070f0); 
    box-shadow: 0 4px 8px rgba(0, 50, 200, 0.4); 
    transform: translateY(-1px); 
}

#controls button:active {
    background: linear-gradient(to bottom, #3060e0, #2050d0); 
    box-shadow: 0 1px 3px rgba(0, 0, 100, 0.4); 
    transform: translateY(1px); 
}

.button-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.button-group label {
    margin-right: 10px;
    margin-bottom: 0;
    width: auto;
    flex-shrink: 0;
}

.button-group button {
    padding: 8px 14px;
    font-size: 16px;
    flex-grow: 1;
    text-align: center;
    margin: 0 4px;
}

.color-group label {
    width: calc(100% - 55px);
    float: left;
}

.color-group input[type="color"] {
    width: 45px;
    height: 28px;
    padding: 0;
    border: 2px solid rgba(100, 150, 250, 0.4);
    background: none;
    cursor: pointer;
    vertical-align: middle;
    float: right;
    border-radius: 6px;
    transition: all 0.2s;
}

.color-group input[type="color"]:hover {
    border-color: rgba(120, 170, 255, 0.8);
    box-shadow: 0 0 10px rgba(70, 130, 255, 0.5);
}

#downloadBtn, #screenshotBtn {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 12px 15px;
    font-weight: 500;
    background: linear-gradient(to bottom, #50c878, #2e8b57); 
}

#downloadBtn:hover, #screenshotBtn:hover {
    background: linear-gradient(to bottom, #60d888, #3e9b67);
}

#screenshotBtn {
    background: linear-gradient(to bottom, #4a80ff, #3060e0);
}

#screenshotBtn:hover {
    background: linear-gradient(to bottom, #5a90ff, #4070f0);
}

/* Group headers for better organization */
.control-section {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(100, 140, 230, 0.3);
    padding-bottom: 10px;
}

.control-section h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #80a0ff;
    font-weight: 500;
}

/* Free fly controls specific styling */
#freeFlyControls {
    background: rgba(20, 40, 80, 0.4);
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
}

#freeFlyControls p {
    margin: 5px 0;
    color: #a0c0ff;
    font-size: 0.85em;
}

#shapeMenu {
    background: rgba(10, 25, 50, 0.9);
    padding: 8px;
    border-radius: 6px;
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.shape-option {
    padding: 8px 10px;
    margin: 0;
    text-align: left;
    background: rgba(40, 60, 120, 0.6);
}

.shape-option:hover {
    background: rgba(60, 80, 150, 0.8);
}